﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Xml;

namespace Redis.Utils
{
    /// <summary>
    /// redis块，在web.config中提供redis块定义
    /// </summary>
    internal class RedisSection : ConfigurationSection
    {
        /// <summary>
        /// 超时
        /// </summary>
        [ConfigurationProperty("SendTimeout", DefaultValue = "-1")]
        public int SendTimeout
        {
            get { return (int)this["SendTimeout"]; }
            set { this["SendTimeout"] = value; }
        }
        /// <summary>
        /// 主机地址
        /// </summary>
        [ConfigurationProperty("Host", DefaultValue = "localhost")]
        public string Host
        {
            get { return (string)this["Host"]; }
            set { this["Host"] = value; }
        }
        /// <summary>
        /// 端口号
        /// </summary>
        [ConfigurationProperty("Port", DefaultValue = "6379")]
        public int Port
        {
            get { return (int)this["Port"]; }
            set { this["Port"] = value; }
        }
        /// <summary>
        /// 验证密码
        /// </summary>
        [ConfigurationProperty("PassWord", DefaultValue = "")]
        public string PassWord
        {
            get { return (string)this["PassWord"]; }
            set { this["PassWord"] = value; }
        }
        /// <summary>
        /// 默认数据库
        /// </summary>
        [ConfigurationProperty("DefaultDB", DefaultValue = "1")]
        public int DefaultDB
        {
            get { return (int)this["DefaultDB"]; }
            set { this["DefaultDB"] = value; }
        }

    }
}
